home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 42 / Mac Magazin and MacEasy Magazine CD - Issue 42.iso / Software / MACup Bestof / Rechner / Menu Events 1.3.1 / Menu Events.h < prev   
Text File  |  1996-02-25  |  4KB  |  114 lines

  1. /*______________________________________________________________________
  2.  
  3.     Menu Events
  4.     
  5.     Version 1.3
  6.  
  7.     an AWOL Software Production
  8.     PO Box 24207
  9.     300 Eagleson Road
  10.     Kanata, Ontario, Canada K2M 2C3
  11.  
  12.     Internet: AWOL@eworld.com
  13.     
  14.     Copyright © 1994-6 Ross Brown.  All rights reserved.
  15. _____________________________________________________________________*/
  16.  
  17.  
  18. /*______________________________________________________________________
  19.     
  20.     'Menu Events'.h - Menu Events Definitions.
  21.  
  22.     This file defines the Apple events which you can send to any
  23.     high-level-event-aware process when Menu Events is installed.
  24.     
  25.     The Query Menu List event returns a list of menu info records,
  26.     each with ID, title, enabled/disabled status, and menu
  27.     definition procedure resource ID.
  28.     
  29.     The Query Menu event, given a menu ID or title, returns a list
  30.     of menu item records, each with ID, title, enabled/disabled status,
  31.     mark character, icon number, style, and Command-key character.
  32.     It simulates a click in the menu bar to force the target to
  33.     updates its menus.  You can optionally specify which modifier
  34.     keys (Shift, Control, Option, Command) are pressed at the time
  35.     of the simulated menu bar click.
  36.     
  37.     The Select Menu Item event, given a menu ID or title and menu
  38.     item ID or item text, causes the target to act as if the given
  39.     item had been selected by the user.  You can optionally specify
  40.     which modifier keys (Shift, Control, Option, Command) are pressed
  41.     at the time of the simulated menu item selection.
  42.     
  43.     Use AppleScript's Script Editor or any Apple event tool to read
  44.     the dictionary for this suite of events from the Menu Events
  45.     Scripting Addition file.  See the Menu Events Sample Script file
  46.     for an example of Menu event scripting.  There is also a full
  47.     description of the Menu Events suite in the Menu Events Help file.
  48. _____________________________________________________________________*/
  49.  
  50.  
  51. #ifndef    __MENU_EVENTS__
  52. #define    __MENU_EVENTS__
  53.  
  54.  
  55. #ifndef    __TYPES__
  56. #include    <Types.h>
  57. #endif
  58.  
  59.  
  60. /* Signature of the Menu Events extension. */
  61.  
  62. #define    kMESignature    'Mænu'
  63.  
  64.  
  65. /* Gestalt selector and response bits for the Menu Events extension. */
  66.  
  67. #define    gestaltMenuEventsAttr    kMESignature
  68.  
  69. #define    gestaltMEQueryEventSupport    0
  70. #define    gestaltMESelectEventSupport    1
  71.  
  72.  
  73. /* Error codes returned by the Menu Events Apple event suite. */
  74.  
  75. #define    noSuchMenuErr        ( -15950 )    /* no such menu in menu bar */
  76. #define    noSuchMenuItemErr    ( -15951 )    /* no such item in menu */
  77. #define    menuItemDisabledErr    ( -15952 )    /* item is disabled */
  78. #define    menuEventPendingErr    ( -15953 )    /* another menu event is pending */
  79. #define    nonStandardMenuErr    ( -15954 )    /* obsolete, kept for compatibility */
  80. #define    menuMismatchErr        ( -15955 )    /* menu ID does not match title */
  81. #define    menuItemMismatchErr    ( -15956 )    /* menu item ID does not match item text */
  82.  
  83.  
  84. /* Class, ID, and key definitions for the Menu Events Apple event suite. */
  85.  
  86. #define    kMEEventClass    kMESignature
  87.  
  88. #define    kAEMEQueryMenuList    'qmn#'
  89. #define    kAEMEQueryMenu    'qmn '
  90. #define    kAEMESelectMenuItem    'semi'
  91.  
  92. #define    keyMenuID    'mnid'
  93. #define    keyMenuTitle    'mnti'
  94. #define    keyMenuEnabled    'mnen'
  95. #define    keyMenuMDEFID    'mndf'
  96.  
  97. #define    keyMenuItemID    'miid'
  98. #define    keyMenuItemText    'mite'
  99. #define    keyMenuItemEnabled    'mien'
  100. #define    keyMenuItemMark    'mima'
  101. #define    keyMenuItemIcon    'miic'
  102. #define    keyMenuItemStyle    'mist'
  103. #define    keyMenuItemCmd    'micm'
  104.  
  105. #define    keyShiftKeyPressed    'shik'
  106. #define    keyControlKeyPressed    'conk'
  107. #define    keyOptionKeyPressed    'optk'
  108. #define    keyCommandKeyPressed    'comk'
  109.  
  110. #define    keyMenuEventsTattoo    kMESignature    /* null; presence verifies handling of event */
  111.  
  112.  
  113. #endif    __MENU_EVENTS__
  114.